home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 9
/
The PC-SIG Library on CD ROM - Ninth Edition.iso
/
401_500
/
DISK0417
/
DISK0417.ZIP
/
PROLOG.ARC
/
SAMPLES.ARC
/
FAMILY.PRO
< prev
next >
Wrap
Text File
|
1986-07-20
|
768b
|
28 lines
/* To analyze the family structure of the family of Queen Victoria.
English friend of mine notes there wasn't a Harry. I put him in.
Answers the compelling question: Who is X the sister of?
Ask: ?-sisterof( alice, X ). or ?-sisterof( alice, harry ).
or ?-sisterof( alice, X ), loves( X, wine ). as an example of a
complex question.
or even:
sisterof( alice, X ), loves( X, wine ), loves( alice, wine ).
*/
sisterof( X, Y ) :- parents( X, M, F ),
female( X ),
parents( Y, M, F ).
parents( edward, victoria, albert ).
parents( harry, victoria, albert ).
parents( alice, victoria, albert ).
female( alice ).
loves( harry, wine ).
loves( alice, wine ).